//
//  FeedParseOperation.h
//  Feed Rider
//
//  Created by Adrian-Sergiu Nicuta on 08/10/11.
//  Copyright 2011 Adrisen Technologies SPRL. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TempItem.h"
#import "Feed.h"

extern NSString *kAddFeedItemsNotif;
extern NSString *kFeedResultsKey;
extern NSString *kFeedItemsErrorNotif;
extern NSString *kFeedItemsMsgErrorKey;

@interface FeedParseOperation : NSOperation <NSXMLParserDelegate> {
@private
    NSDateFormatter *dateFormatter1;
    NSDateFormatter *dateFormatter2;
    BOOL accumulatingParsedCharacterData;
    BOOL didAbortParsing;
    NSUInteger parsedItemsCounter;
    NSManagedObjectContext *managedObjectContext;
    Feed *currentFeed;
    NSRegularExpression *regex;
}

@property (nonatomic, retain) TempItem *currentFeedItem;
@property (nonatomic, retain) NSManagedObjectID *currentFeedId;
@property (copy, readonly) NSData *feedData;
@property (nonatomic, retain) NSMutableArray *currentParseBatch;
@property (nonatomic, retain) NSMutableString *currentParsedCharacterData;
@property (nonatomic, retain) NSDate *oldDate;

- (id)initWithData:(NSData *)data;

@end
